package com.zhaopin.mianshi;

import lombok.SneakyThrows;

import java.util.concurrent.TimeUnit;

import static com.zhaopin.mianshi.Singleton.getSingleton;

/**
 * @author yin.peide
 * @date 2021-05-07 14:38
 */
public class MyThread implements Runnable {

    private Singleton singleton;
    private int i;


    public MyThread(int i){
        this.i = i;
        this.singleton = getSingleton();
    }

    @SneakyThrows
    @Override
    public void run() {
        TimeUnit.SECONDS.sleep(i);
        System.out.println(i+"" +  singleton);
    }
}
